/* Layout */
import Layout from '../views/layout/Layout'
import { mapToArray } from '@/utils/base'

const _import = require('./_import_' + process.env.NODE_ENV);
export const gameManageRoleType = {
  'set': 'game-set',
  maintain: 'game-maintain',
  gameConfig: 'game-config',
  edit: 'edit-maintain',
  log: 'log-maintain',
  ptSwitch: 'pt-switch',
  ptEdit: 'pt-edit'
}

export const gameRoutes = [
  {
    path: '/game',
    component: Layout,
    redirect: 'noredirect',
    name: 'game',
    meta: {
      title: '游戏管理',
      icon: 'documentation',
      roles: []
    },
    children: [
      {
        path: 'game-management',
        name: 'game-management',
        component: _import('gameManager/game/index'),
        meta: {
          title: '游戏管理',
          notLog: true,
          roles: mapToArray(gameManageRoleType)
        },
      },
      {
        path: 'game-bet-list',
        name: 'game-bet-list',
        component: _import('gameManager/detail/index'),
        meta: {
          title: '注单管理',
          roles: ['virtual'/*虚拟数据查看*/, 'export'/*导出按钮*/],
          noCache:true,
          notLog: true
        },

        props: (route) => (
          {
            username: route.query.username,
            form:route.query.form,
          }
        )
      },
      {
        path: 'game-hot-game-set',
        name: 'game-hot-game-set',
        component: _import('gameManager/hotGame/index'),
        meta: {
          title: '热门赛事配置',
          roles: ['push','']
        },
      },
    ]
  }
]

